﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MsgList.ascx.cs" Inherits="ZWZ.Web.WebAdmin.UCtrs.MsgList" %>
<style type="text/css">
    .msgitem-img, .msgitem-ag, .msgitem-box{ display: inline-block;}
    .msgitem-img{ width: 70px; text-align: center; vertical-align: top;  padding: 5px;}
    .msgitem-img img{  width: 60px; max-height: 100px; }
    .msgitem-ag{ width: 8px; height: 50px; background-repeat: no-repeat; z-index: 100; position: relative; background-position: 0px 15px; }
    .msgitem-box{ padding: 10px 20px; width: 500px; font-size: 14px; font-family: 宋体; position: relative; }
    .msgitem-box img{ max-width:500px; height:auto; margin:auto;}
    .msgitem-date{ color: #999; text-align: right;}
    .leftitem .msgitem-img, .leftitem .msgitem-ag, .leftitem .msgitem-box { float: left; }
    .leftitem .msgitem-box { background-color: rgb(242, 248, 251); border: 1px solid #e1e9ed; }
    .leftitem .msgitem-ag{background-image: url(/webadmin/images/msg_box_arrow_left.gif); margin-right: -1px; }
    .rightitem .msgitem-img, .rightitem .msgitem-ag, .rightitem .msgitem-box{ float: right; }
    .rightitem .msgitem-box{ background-color: rgb(251, 250, 242); border: 1px solid #eceadb; }
    .rightitem .msgitem-ag { background-image: url(/webadmin/images/msg_box_arrow_right.gif); margin-left: -1px; }
</style>
<script type="text/javascript">
    var editor;
    $(function () {
        document.getElementById('ctndiv').scrollTop = document.getElementById('ctntable').scrollHeight+40;
        editor = new UE.ui.Editor();
        editor.render("myEditor");
    });
    function SetTitle() {
        document.getElementById('<%=hidTitle.ClientID%>').value
                = editor.getContentTxt();
    }
</script>
<script src="/WebPage/JsControl/Jquery/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="/WebPage/JsControl/ueditor/ueditor.config_msg2.js" type="text/javascript"></script>
<script src="/WebPage/JsControl/ueditor/ueditor.all.min.js" type="text/javascript"></script>
<div class="msgcontainer">
    <div class="msgtitle">
        <asp:Label ID="LabTitle" runat="server" Text="Label"></asp:Label>
    </div>
    <div id="ctndiv" style='height: <%=Height %>; overflow-y: scroll; padding: 0px 30px;'>
        <div class="clear20">
        </div>
        <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
            <HeaderTemplate>
                <table id="ctntable" cellpadding="0" cellspacing="0" class="msglist-container">
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:Panel CssClass="leftitem" ID="PanItem" runat="server">
                            <div class="msgitem-img">
                                <asp:Image ID="ImgPic" runat="server" />
                            </div>
                            <div class="msgitem-ag">
                                &nbsp;
                            </div>
                            <div class="msgitem-box">
                                <p>
                                    <%#Eval("Body") %></p>
                                <div class="msgitem-date">
                                    <%#Eval("SentTime","{0:yyyy-MM-dd HH:mm}") %></div>
                            </div>
                            </div>
                        </asp:Panel>
                        <div class="clear20">
                        </div>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <div class="clear20">
        </div>
    </div>
    <div>
        <asp:HiddenField ID="hidTitle" runat="server" />
        <script id="myEditor" type="text/plain" name="myContent"></script>
    </div>
    <div class="msgfooter">
        <div class="clear">
        </div>
        <asp:Button ID="BtnSend" runat="server" OnClientClick="SetTitle();" 
            CssClass="tools-btn tools-btn-sure" Text="发送" onclick="BtnSend_Click" />
        <div class="clear">
        </div>
    </div>
</div>
